Skip to content

[nanvix] fix(z): disable libc++ filesystem (incomplete POSIX fs in Nanvix libc)#38

Merged
ppenna merged 1 commit into
nanvix/v21.0.0from
bugfix-stage1-libcxx-filesystem
Jun 30, 2026
Merged

[nanvix] fix(z): disable libc++ filesystem (incomplete POSIX fs in Nanvix libc)#38
ppenna merged 1 commit into
nanvix/v21.0.0from
bugfix-stage1-libcxx-filesystem

Conversation

@ppenna

@ppenna ppenna commented Jun 30, 2026

Copy link
Copy Markdown

Problem

With localization disabled (#37), the libc++ build reached <filesystem> and failed:

filesystem/operations.cpp: error: use of undeclared identifier '_PC_PATH_MAX'
filesystem/operations.cpp: error: use of undeclared identifier 'copy_file_impl_fstream'

libc++'s <filesystem> uses POSIX facilities the Nanvix libc doesn't provide (e.g. _PC_PATH_MAX for pathconf), and its copy_file fallback is implemented with <fstream> — unavailable now that localization (and thus iostream/fstream) is off.

Fix

-DLIBCXX_ENABLE_FILESYSTEM=OFF. Matches libc++ to the libc; drops <filesystem>. Reversible once the Nanvix libc provides the required POSIX filesystem API (and iostream is available again).

Caveat

Iterative stage-1 bring-up converging on a minimal libc++ for the minimal Nanvix libc (so far: wide-chars, localization, filesystem off). Subsequent libc++ compile or link issues may surface next. Validated on merge.

…nvix libc)

With localization disabled, the libc++ build reached <filesystem> and failed:

  filesystem/operations.cpp: error: use of undeclared identifier '_PC_PATH_MAX'
  filesystem/operations.cpp: error: use of undeclared identifier 'copy_file_impl_fstream'

libc++'s <filesystem> uses POSIX facilities the Nanvix libc does not provide
(e.g. _PC_PATH_MAX for pathconf), and its copy_file fallback is implemented
with <fstream>, which is unavailable now that localization (and thus the
iostream/fstream machinery) is off.

Set LIBCXX_ENABLE_FILESYSTEM=OFF to match libc++ to the libc. Drops
<filesystem>. Re-enable once the Nanvix libc provides the required POSIX
filesystem API (and iostream is available again).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ppenna ppenna merged commit 35bcc4d into nanvix/v21.0.0 Jun 30, 2026
1 check passed
@ppenna ppenna deleted the bugfix-stage1-libcxx-filesystem branch June 30, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant